# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Example do
  @moduledoc """
  An Example is a piece of data and its annotation. For example, an image with label "house".

  ## Attributes

  *   `annotations` (*type:* `list(GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Annotation.t)`, *default:* `nil`) - Output only. Annotations for the piece of data in Example. One piece of data can have multiple annotations.
  *   `imagePayload` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1ImagePayload.t`, *default:* `nil`) - The image payload, a container of the image bytes/uri.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the example, in format of: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}/examples/{example_id}
  *   `textPayload` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1TextPayload.t`, *default:* `nil`) - The text payload, a container of the text content.
  *   `videoPayload` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1VideoPayload.t`, *default:* `nil`) - The video payload, a container of the video uri.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotations =>
            list(
              GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Annotation.t()
            )
            | nil,
          :imagePayload =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1ImagePayload.t()
            | nil,
          :name => String.t() | nil,
          :textPayload =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1TextPayload.t()
            | nil,
          :videoPayload =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1VideoPayload.t()
            | nil
        }

  field(:annotations,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Annotation,
    type: :list
  )

  field(:imagePayload,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1ImagePayload
  )

  field(:name)

  field(:textPayload,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1TextPayload
  )

  field(:videoPayload,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1VideoPayload
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Example do
  def decode(value, options) do
    GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Example.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1Example do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
